﻿@model OJS.Web.Areas.Administration.ViewModels.ProblemResource.ProblemResourceViewModel

<div class="resourceRow container" id="resource-row-@Model.Id">
    <br />
    <input type="hidden" id="Resources_@(Model.Id)__Id" class="hidden-field" name="Resources[@Model.Id].Id" />
    <div class="col-md-2">
        <label for="Resources_@(Model.Id)__Name">Име</label>
        @Html.TextBox("Resources[" + Model.Id + "].Name", null, new { id = "Resources_" + Model.Id + "__Name", @class = "form-control full-editor required-resource-field" })
        @Html.ValidationMessage("Resources[" + Model.Id + "].Name")
    </div>
    <div class="col-md-2">
        <label for="Resources_@(Model.Id)__Type">Тип</label>
        @(Html.Kendo()
        .DropDownList()
        .Name("Resources[" + Model.Id + "].Type")
        .BindTo(Model.AllTypes)
        .Events(ev => ev.Change("onResourceTypeSelect"))
        .HtmlAttributes(new { id = "Resources_" + Model.Id + "__Type", @class = "full-kendo-editor", modelid = Model.Id }))
    </div>
    <div class="col-md-2">
        <div class="pull-right" data-type="resource-content">
            <div><strong>Файл</strong></div>
            <div id="file-button-@Model.Id" data-file-upload-button="true" data-id="@Model.Id" class="btn btn-sm btn-primary" onclick="startUploadForm(this)">Избери ресурс</div>
            <div class="hidden-file-upload">
                <input type="file" class="required-resource-field" name="Resources[@Model.Id].File" id="Resources_@(Model.Id)__File" data-id="@Model.Id" onchange="selectedFile(this)" />
            </div>
        </div>
        @Html.ValidationMessage("Resources[" + Model.Id + "].File", new { @class = "pull-right" })
    </div>
</div>